package mylab.starters.mq.impl.local;

import mylab.starters.mq.AbstractMqTemplate;
import mylab.starters.mq.MqProvider;
import mylab.starters.mq.api.Consumer;
import mylab.starters.mq.api.Producer;
import mylab.starters.mq.config.MqPropperties;
import mylab.utils.spring.spi.SpiProvider;

public class LocalMqTemplate extends AbstractMqTemplate {
    public LocalMqTemplate(MqPropperties.LocalMqProperties properties) {
        super(properties);
    }

    @Override
    public SpiProvider getProvider() {
        return MqProvider.Kafka;
    }


    @Override
    public Producer createProducer(String producerGroupId, String clientId) {
        return new LocalProducer(this.properties, producerGroupId, clientId);
    }

    @Override
    public Consumer createConsumer(String consumerGroupId, String clientId) {
        return new LocalConsumer(this.properties, consumerGroupId, clientId);
    }
}
